<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Fetch JSON Example</title>
</head>
<body>
<div id="output"></div>

<script>
    fetch('./data.json')
            .then(response => {
                if (!response.ok) {
                    throw new Error('Network response was not ok ' + response.statusText);
                }
                return response.json();
            })
            .then(data => {
                document.getElementById('output').innerText = `Name:  ${data.name}, Age:  ${data.age}, City:  ${data.city}`;
            })
            .catch(error => {
                console.error('There has been a problem with your fetch operation:', error);
            });
</script>
</body>
</html>